/*
  Arduino.h - Main include file for the Arduino SDK
  Copyright (c) 2005-2013 Arduino Team.  All right reserved.

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

/* sketch */
#ifndef _ARDUINO_H_
#define _ARDUINO_H_

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

#include "zino_instance.h"

	extern void setup(void) ;
	extern void loop(void) ;
    //void updateNUM(u8 num, u8 x, u8 y, u8 r, u8 g, u8 b);
    //void updateLetter(int letter, int xx, int yy, int r, int g, int b);
    typedef  uint8_t byte;
    typedef  uint16_t word;
//
//#define PI 3.1415926535897932384626433832795
#define HALF_PI 1.5707963267948966192313216916398
#define TWO_PI 6.283185307179586476925286766559
#define DEG_TO_RAD 0.017453292519943295769236907684886
#define RAD_TO_DEG 57.295779513082320876798154814105
#define EULER 2.718281828459045235360287471352
//#define randomSeed(x) srand(x)
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))

#ifndef abs
#define abs(x) ((x)>0?(x):-(x))
#endif // !abs

#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
// #define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
#define radians(deg) ((deg)*DEG_TO_RAD)
#define degrees(rad) ((rad)*RAD_TO_DEG)
#define sq(x) ((x)*(x))

void setup(void) ;
void loop(void) ;

typedef  uint8_t byte;
typedef  uint16_t word;
   

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus

#ifdef __cplusplus // __cplusplus

#ifdef AT32F415RCT7
 // WMath prototypes
long random(long);
long random(long, long);
void randomSeed(unsigned long);
long map(long, long, long, long, long);
#endif // AT32F415RCT7

#ifdef AT32F413Rx_HD

#endif // AT32F413Rx_HD

#endif // __cplusplus

#endif // _ARDUINO_H_

